package ua.com.jpy.entity.catagory;

import java.util.List;
import java.util.Map;
import java.util.Set;

import org.bson.types.ObjectId;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.NotEmpty;

import ua.com.jpy.entity.IEntity;
import ua.com.jpy.entity.catagory.product.Product;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;

/**
 * @author LSD25
 *
 */
@Entity(noClassnameStored = true)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public class Catagory implements IEntity {
	
	@Id
	private ObjectId id;
	
	@NotBlank
	private String name;
	
	@NotEmpty
	private Set<Product> productSet;
	
	private Map<ObjectId, Integer> countView;
	
	private int levelCategory;
	
	private List<ObjectId> catagoryChild;
	
	private List<ObjectId> parentCatagory;

	public ObjectId getId() {
		return id;
	}

	public void setId(ObjectId id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Set<Product> getProductSet() {
		return productSet;
	}

	public void setProductSet(Set<Product> productSet) {
		this.productSet = productSet;
	}

	public Map<ObjectId, Integer> getCountView() {
		return countView;
	}

	public void setCountView(Map<ObjectId, Integer> countView) {
		this.countView = countView;
	}

	public int getLevelCategory() {
		return levelCategory;
	}

	public void setLevelCategory(int levelCategory) {
		this.levelCategory = levelCategory;
	}

	public List<ObjectId> getCatagoryChild() {
		return catagoryChild;
	}

	public void setCatagoryChild(List<ObjectId> catagoryChild) {
		this.catagoryChild = catagoryChild;
	}

	public List<ObjectId> getParentCatagory() {
		return parentCatagory;
	}

	public void setParentCatagory(List<ObjectId> parentCatagory) {
		this.parentCatagory = parentCatagory;
	}
	
}
